3.2.5 \(\int \frac {d+e x+f x^2}{(g+h x) \sqrt {a+c x^2}} \, dx\) [105]

3.2.5.1 Optimal result
3.2.5.2 Mathematica [A] (verified)
3.2.5.3 Rubi [A] (verified)
3.2.5.4 Maple [A] (verified)
3.2.5.5 Fricas [A] (verification not implemented)
3.2.5.6 Sympy [F]
3.2.5.7 Maxima [A] (verification not implemented)
3.2.5.8 Giac [F(-2)]
3.2.5.9 Mupad [F(-1)]

3.2.5.1 Optimal result

Integrand size = 29, antiderivative size = 130 \[ \int \frac {d+e x+f x^2}{(g+h x) \sqrt {a+c x^2}} \, dx=\frac {f \sqrt {a+c x^2}}{c h}-\frac {(f g-e h) \text {arctanh}\left (\frac {\sqrt {c} x}{\sqrt {a+c x^2}}\right )}{\sqrt {c} h^2}-\frac {\left (f g^2-e g h+d h^2\right ) \text {arctanh}\left (\frac {a h-c g x}{\sqrt {c g^2+a h^2} \sqrt {a+c x^2}}\right )}{h^2 \sqrt {c g^2+a h^2}} \]

output
-(-e*h+f*g)*arctanh(x*c^(1/2)/(c*x^2+a)^(1/2))/h^2/c^(1/2)-(d*h^2-e*g*h+f* 
g^2)*arctanh((-c*g*x+a*h)/(a*h^2+c*g^2)^(1/2)/(c*x^2+a)^(1/2))/h^2/(a*h^2+ 
c*g^2)^(1/2)+f*(c*x^2+a)^(1/2)/c/h
 
3.2.5.2 Mathematica [A] (verified)

Time = 0.46 (sec) , antiderivative size = 137, normalized size of antiderivative = 1.05 \[ \int \frac {d+e x+f x^2}{(g+h x) \sqrt {a+c x^2}} \, dx=\frac {\frac {f h \sqrt {a+c x^2}}{c}-\frac {2 \left (f g^2+h (-e g+d h)\right ) \arctan \left (\frac {\sqrt {c} (g+h x)-h \sqrt {a+c x^2}}{\sqrt {-c g^2-a h^2}}\right )}{\sqrt {-c g^2-a h^2}}+\frac {(f g-e h) \log \left (-\sqrt {c} x+\sqrt {a+c x^2}\right )}{\sqrt {c}}}{h^2} \]

input
Integrate[(d + e*x + f*x^2)/((g + h*x)*Sqrt[a + c*x^2]),x]
 
output
((f*h*Sqrt[a + c*x^2])/c - (2*(f*g^2 + h*(-(e*g) + d*h))*ArcTan[(Sqrt[c]*( 
g + h*x) - h*Sqrt[a + c*x^2])/Sqrt[-(c*g^2) - a*h^2]])/Sqrt[-(c*g^2) - a*h 
^2] + ((f*g - e*h)*Log[-(Sqrt[c]*x) + Sqrt[a + c*x^2]])/Sqrt[c])/h^2
 
3.2.5.3 Rubi [A] (verified)

Time = 0.35 (sec) , antiderivative size = 135, normalized size of antiderivative = 1.04, number of steps used = 8, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.241, Rules used = {2185, 27, 719, 224, 219, 488, 219}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \frac {d+e x+f x^2}{\sqrt {a+c x^2} (g+h x)} \, dx\)

\(\Big \downarrow \) 2185

\(\displaystyle \frac {\int \frac {c h (d h-(f g-e h) x)}{(g+h x) \sqrt {c x^2+a}}dx}{c h^2}+\frac {f \sqrt {a+c x^2}}{c h}\)

\(\Big \downarrow \) 27

\(\displaystyle \frac {\int \frac {d h-(f g-e h) x}{(g+h x) \sqrt {c x^2+a}}dx}{h}+\frac {f \sqrt {a+c x^2}}{c h}\)

\(\Big \downarrow \) 719

\(\displaystyle \frac {\frac {\left (d h^2-e g h+f g^2\right ) \int \frac {1}{(g+h x) \sqrt {c x^2+a}}dx}{h}-\frac {(f g-e h) \int \frac {1}{\sqrt {c x^2+a}}dx}{h}}{h}+\frac {f \sqrt {a+c x^2}}{c h}\)

\(\Big \downarrow \) 224

\(\displaystyle \frac {\frac {\left (d h^2-e g h+f g^2\right ) \int \frac {1}{(g+h x) \sqrt {c x^2+a}}dx}{h}-\frac {(f g-e h) \int \frac {1}{1-\frac {c x^2}{c x^2+a}}d\frac {x}{\sqrt {c x^2+a}}}{h}}{h}+\frac {f \sqrt {a+c x^2}}{c h}\)

\(\Big \downarrow \) 219

\(\displaystyle \frac {\frac {\left (d h^2-e g h+f g^2\right ) \int \frac {1}{(g+h x) \sqrt {c x^2+a}}dx}{h}-\frac {\text {arctanh}\left (\frac {\sqrt {c} x}{\sqrt {a+c x^2}}\right ) (f g-e h)}{\sqrt {c} h}}{h}+\frac {f \sqrt {a+c x^2}}{c h}\)

\(\Big \downarrow \) 488

\(\displaystyle \frac {-\frac {\left (d h^2-e g h+f g^2\right ) \int \frac {1}{c g^2+a h^2-\frac {(a h-c g x)^2}{c x^2+a}}d\frac {a h-c g x}{\sqrt {c x^2+a}}}{h}-\frac {\text {arctanh}\left (\frac {\sqrt {c} x}{\sqrt {a+c x^2}}\right ) (f g-e h)}{\sqrt {c} h}}{h}+\frac {f \sqrt {a+c x^2}}{c h}\)

\(\Big \downarrow \) 219

\(\displaystyle \frac {-\frac {\left (d h^2-e g h+f g^2\right ) \text {arctanh}\left (\frac {a h-c g x}{\sqrt {a+c x^2} \sqrt {a h^2+c g^2}}\right )}{h \sqrt {a h^2+c g^2}}-\frac {\text {arctanh}\left (\frac {\sqrt {c} x}{\sqrt {a+c x^2}}\right ) (f g-e h)}{\sqrt {c} h}}{h}+\frac {f \sqrt {a+c x^2}}{c h}\)

input
Int[(d + e*x + f*x^2)/((g + h*x)*Sqrt[a + c*x^2]),x]
 
output
(f*Sqrt[a + c*x^2])/(c*h) + (-(((f*g - e*h)*ArcTanh[(Sqrt[c]*x)/Sqrt[a + c 
*x^2]])/(Sqrt[c]*h)) - ((f*g^2 - e*g*h + d*h^2)*ArcTanh[(a*h - c*g*x)/(Sqr 
t[c*g^2 + a*h^2]*Sqrt[a + c*x^2])])/(h*Sqrt[c*g^2 + a*h^2]))/h
 

3.2.5.3.1 Defintions of rubi rules used

rule 27
Int[(a_)*(Fx_), x_Symbol] :> Simp[a   Int[Fx, x], x] /; FreeQ[a, x] &&  !Ma 
tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
 

rule 219
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))* 
ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && NegQ[a/b] && (Gt 
Q[a, 0] || LtQ[b, 0])
 

rule 224
Int[1/Sqrt[(a_) + (b_.)*(x_)^2], x_Symbol] :> Subst[Int[1/(1 - b*x^2), x], 
x, x/Sqrt[a + b*x^2]] /; FreeQ[{a, b}, x] &&  !GtQ[a, 0]
 

rule 488
Int[1/(((c_) + (d_.)*(x_))*Sqrt[(a_) + (b_.)*(x_)^2]), x_Symbol] :> -Subst[ 
Int[1/(b*c^2 + a*d^2 - x^2), x], x, (a*d - b*c*x)/Sqrt[a + b*x^2]] /; FreeQ 
[{a, b, c, d}, x]
 

rule 719
Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))*((a_) + (c_.)*(x_)^2)^(p 
_.), x_Symbol] :> Simp[g/e   Int[(d + e*x)^(m + 1)*(a + c*x^2)^p, x], x] + 
Simp[(e*f - d*g)/e   Int[(d + e*x)^m*(a + c*x^2)^p, x], x] /; FreeQ[{a, c, 
d, e, f, g, m, p}, x] &&  !IGtQ[m, 0]
 

rule 2185
Int[(Pq_)*((d_) + (e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^2)^(p_), x_Symbol] : 
> With[{q = Expon[Pq, x], f = Coeff[Pq, x, Expon[Pq, x]]}, Simp[f*(d + e*x) 
^(m + q - 1)*((a + b*x^2)^(p + 1)/(b*e^(q - 1)*(m + q + 2*p + 1))), x] + Si 
mp[1/(b*e^q*(m + q + 2*p + 1))   Int[(d + e*x)^m*(a + b*x^2)^p*ExpandToSum[ 
b*e^q*(m + q + 2*p + 1)*Pq - b*f*(m + q + 2*p + 1)*(d + e*x)^q - f*(d + e*x 
)^(q - 2)*(a*e^2*(m + q - 1) - b*d^2*(m + q + 2*p + 1) - 2*b*d*e*(m + q + p 
)*x), x], x], x] /; GtQ[q, 1] && NeQ[m + q + 2*p + 1, 0]] /; FreeQ[{a, b, d 
, e, m, p}, x] && PolyQ[Pq, x] && NeQ[b*d^2 + a*e^2, 0] &&  !(EqQ[d, 0] && 
True) &&  !(IGtQ[m, 0] && RationalQ[a, b, d, e] && (IntegerQ[p] || ILtQ[p + 
 1/2, 0]))
 
3.2.5.4 Maple [A] (verified)

Time = 0.55 (sec) , antiderivative size = 197, normalized size of antiderivative = 1.52

method result size
risch \(\frac {f \sqrt {c \,x^{2}+a}}{c h}+\frac {\frac {\left (e h -f g \right ) \ln \left (x \sqrt {c}+\sqrt {c \,x^{2}+a}\right )}{h \sqrt {c}}-\frac {\left (d \,h^{2}-e g h +f \,g^{2}\right ) \ln \left (\frac {\frac {2 a \,h^{2}+2 c \,g^{2}}{h^{2}}-\frac {2 c g \left (x +\frac {g}{h}\right )}{h}+2 \sqrt {\frac {a \,h^{2}+c \,g^{2}}{h^{2}}}\, \sqrt {\left (x +\frac {g}{h}\right )^{2} c -\frac {2 c g \left (x +\frac {g}{h}\right )}{h}+\frac {a \,h^{2}+c \,g^{2}}{h^{2}}}}{x +\frac {g}{h}}\right )}{h^{2} \sqrt {\frac {a \,h^{2}+c \,g^{2}}{h^{2}}}}}{h}\) \(197\)
default \(\frac {\frac {e h \ln \left (x \sqrt {c}+\sqrt {c \,x^{2}+a}\right )}{\sqrt {c}}+\frac {f h \sqrt {c \,x^{2}+a}}{c}-\frac {f g \ln \left (x \sqrt {c}+\sqrt {c \,x^{2}+a}\right )}{\sqrt {c}}}{h^{2}}-\frac {\left (d \,h^{2}-e g h +f \,g^{2}\right ) \ln \left (\frac {\frac {2 a \,h^{2}+2 c \,g^{2}}{h^{2}}-\frac {2 c g \left (x +\frac {g}{h}\right )}{h}+2 \sqrt {\frac {a \,h^{2}+c \,g^{2}}{h^{2}}}\, \sqrt {\left (x +\frac {g}{h}\right )^{2} c -\frac {2 c g \left (x +\frac {g}{h}\right )}{h}+\frac {a \,h^{2}+c \,g^{2}}{h^{2}}}}{x +\frac {g}{h}}\right )}{h^{3} \sqrt {\frac {a \,h^{2}+c \,g^{2}}{h^{2}}}}\) \(209\)

input
int((f*x^2+e*x+d)/(h*x+g)/(c*x^2+a)^(1/2),x,method=_RETURNVERBOSE)
 
output
f*(c*x^2+a)^(1/2)/c/h+1/h*((e*h-f*g)/h*ln(x*c^(1/2)+(c*x^2+a)^(1/2))/c^(1/ 
2)-(d*h^2-e*g*h+f*g^2)/h^2/((a*h^2+c*g^2)/h^2)^(1/2)*ln((2*(a*h^2+c*g^2)/h 
^2-2*c*g/h*(x+1/h*g)+2*((a*h^2+c*g^2)/h^2)^(1/2)*((x+1/h*g)^2*c-2*c*g/h*(x 
+1/h*g)+(a*h^2+c*g^2)/h^2)^(1/2))/(x+1/h*g)))
 
3.2.5.5 Fricas [A] (verification not implemented)

Time = 114.78 (sec) , antiderivative size = 881, normalized size of antiderivative = 6.78 \[ \int \frac {d+e x+f x^2}{(g+h x) \sqrt {a+c x^2}} \, dx=\left [-\frac {{\left (c f g^{3} - c e g^{2} h + a f g h^{2} - a e h^{3}\right )} \sqrt {c} \log \left (-2 \, c x^{2} - 2 \, \sqrt {c x^{2} + a} \sqrt {c} x - a\right ) - {\left (c f g^{2} - c e g h + c d h^{2}\right )} \sqrt {c g^{2} + a h^{2}} \log \left (\frac {2 \, a c g h x - a c g^{2} - 2 \, a^{2} h^{2} - {\left (2 \, c^{2} g^{2} + a c h^{2}\right )} x^{2} - 2 \, \sqrt {c g^{2} + a h^{2}} {\left (c g x - a h\right )} \sqrt {c x^{2} + a}}{h^{2} x^{2} + 2 \, g h x + g^{2}}\right ) - 2 \, {\left (c f g^{2} h + a f h^{3}\right )} \sqrt {c x^{2} + a}}{2 \, {\left (c^{2} g^{2} h^{2} + a c h^{4}\right )}}, -\frac {2 \, {\left (c f g^{2} - c e g h + c d h^{2}\right )} \sqrt {-c g^{2} - a h^{2}} \arctan \left (\frac {\sqrt {-c g^{2} - a h^{2}} {\left (c g x - a h\right )} \sqrt {c x^{2} + a}}{a c g^{2} + a^{2} h^{2} + {\left (c^{2} g^{2} + a c h^{2}\right )} x^{2}}\right ) + {\left (c f g^{3} - c e g^{2} h + a f g h^{2} - a e h^{3}\right )} \sqrt {c} \log \left (-2 \, c x^{2} - 2 \, \sqrt {c x^{2} + a} \sqrt {c} x - a\right ) - 2 \, {\left (c f g^{2} h + a f h^{3}\right )} \sqrt {c x^{2} + a}}{2 \, {\left (c^{2} g^{2} h^{2} + a c h^{4}\right )}}, \frac {2 \, {\left (c f g^{3} - c e g^{2} h + a f g h^{2} - a e h^{3}\right )} \sqrt {-c} \arctan \left (\frac {\sqrt {-c} x}{\sqrt {c x^{2} + a}}\right ) + {\left (c f g^{2} - c e g h + c d h^{2}\right )} \sqrt {c g^{2} + a h^{2}} \log \left (\frac {2 \, a c g h x - a c g^{2} - 2 \, a^{2} h^{2} - {\left (2 \, c^{2} g^{2} + a c h^{2}\right )} x^{2} - 2 \, \sqrt {c g^{2} + a h^{2}} {\left (c g x - a h\right )} \sqrt {c x^{2} + a}}{h^{2} x^{2} + 2 \, g h x + g^{2}}\right ) + 2 \, {\left (c f g^{2} h + a f h^{3}\right )} \sqrt {c x^{2} + a}}{2 \, {\left (c^{2} g^{2} h^{2} + a c h^{4}\right )}}, -\frac {{\left (c f g^{2} - c e g h + c d h^{2}\right )} \sqrt {-c g^{2} - a h^{2}} \arctan \left (\frac {\sqrt {-c g^{2} - a h^{2}} {\left (c g x - a h\right )} \sqrt {c x^{2} + a}}{a c g^{2} + a^{2} h^{2} + {\left (c^{2} g^{2} + a c h^{2}\right )} x^{2}}\right ) - {\left (c f g^{3} - c e g^{2} h + a f g h^{2} - a e h^{3}\right )} \sqrt {-c} \arctan \left (\frac {\sqrt {-c} x}{\sqrt {c x^{2} + a}}\right ) - {\left (c f g^{2} h + a f h^{3}\right )} \sqrt {c x^{2} + a}}{c^{2} g^{2} h^{2} + a c h^{4}}\right ] \]

input
integrate((f*x^2+e*x+d)/(h*x+g)/(c*x^2+a)^(1/2),x, algorithm="fricas")
 
output
[-1/2*((c*f*g^3 - c*e*g^2*h + a*f*g*h^2 - a*e*h^3)*sqrt(c)*log(-2*c*x^2 - 
2*sqrt(c*x^2 + a)*sqrt(c)*x - a) - (c*f*g^2 - c*e*g*h + c*d*h^2)*sqrt(c*g^ 
2 + a*h^2)*log((2*a*c*g*h*x - a*c*g^2 - 2*a^2*h^2 - (2*c^2*g^2 + a*c*h^2)* 
x^2 - 2*sqrt(c*g^2 + a*h^2)*(c*g*x - a*h)*sqrt(c*x^2 + a))/(h^2*x^2 + 2*g* 
h*x + g^2)) - 2*(c*f*g^2*h + a*f*h^3)*sqrt(c*x^2 + a))/(c^2*g^2*h^2 + a*c* 
h^4), -1/2*(2*(c*f*g^2 - c*e*g*h + c*d*h^2)*sqrt(-c*g^2 - a*h^2)*arctan(sq 
rt(-c*g^2 - a*h^2)*(c*g*x - a*h)*sqrt(c*x^2 + a)/(a*c*g^2 + a^2*h^2 + (c^2 
*g^2 + a*c*h^2)*x^2)) + (c*f*g^3 - c*e*g^2*h + a*f*g*h^2 - a*e*h^3)*sqrt(c 
)*log(-2*c*x^2 - 2*sqrt(c*x^2 + a)*sqrt(c)*x - a) - 2*(c*f*g^2*h + a*f*h^3 
)*sqrt(c*x^2 + a))/(c^2*g^2*h^2 + a*c*h^4), 1/2*(2*(c*f*g^3 - c*e*g^2*h + 
a*f*g*h^2 - a*e*h^3)*sqrt(-c)*arctan(sqrt(-c)*x/sqrt(c*x^2 + a)) + (c*f*g^ 
2 - c*e*g*h + c*d*h^2)*sqrt(c*g^2 + a*h^2)*log((2*a*c*g*h*x - a*c*g^2 - 2* 
a^2*h^2 - (2*c^2*g^2 + a*c*h^2)*x^2 - 2*sqrt(c*g^2 + a*h^2)*(c*g*x - a*h)* 
sqrt(c*x^2 + a))/(h^2*x^2 + 2*g*h*x + g^2)) + 2*(c*f*g^2*h + a*f*h^3)*sqrt 
(c*x^2 + a))/(c^2*g^2*h^2 + a*c*h^4), -((c*f*g^2 - c*e*g*h + c*d*h^2)*sqrt 
(-c*g^2 - a*h^2)*arctan(sqrt(-c*g^2 - a*h^2)*(c*g*x - a*h)*sqrt(c*x^2 + a) 
/(a*c*g^2 + a^2*h^2 + (c^2*g^2 + a*c*h^2)*x^2)) - (c*f*g^3 - c*e*g^2*h + a 
*f*g*h^2 - a*e*h^3)*sqrt(-c)*arctan(sqrt(-c)*x/sqrt(c*x^2 + a)) - (c*f*g^2 
*h + a*f*h^3)*sqrt(c*x^2 + a))/(c^2*g^2*h^2 + a*c*h^4)]
 
3.2.5.6 Sympy [F]

\[ \int \frac {d+e x+f x^2}{(g+h x) \sqrt {a+c x^2}} \, dx=\int \frac {d + e x + f x^{2}}{\sqrt {a + c x^{2}} \left (g + h x\right )}\, dx \]

input
integrate((f*x**2+e*x+d)/(h*x+g)/(c*x**2+a)**(1/2),x)
 
output
Integral((d + e*x + f*x**2)/(sqrt(a + c*x**2)*(g + h*x)), x)
 
3.2.5.7 Maxima [A] (verification not implemented)

Time = 0.22 (sec) , antiderivative size = 218, normalized size of antiderivative = 1.68 \[ \int \frac {d+e x+f x^2}{(g+h x) \sqrt {a+c x^2}} \, dx=-\frac {f g \operatorname {arsinh}\left (\frac {c x}{\sqrt {a c}}\right )}{\sqrt {c} h^{2}} + \frac {e \operatorname {arsinh}\left (\frac {c x}{\sqrt {a c}}\right )}{\sqrt {c} h} + \frac {f g^{2} \operatorname {arsinh}\left (\frac {c g x}{\sqrt {a c} {\left | h x + g \right |}} - \frac {a h}{\sqrt {a c} {\left | h x + g \right |}}\right )}{\sqrt {a + \frac {c g^{2}}{h^{2}}} h^{3}} - \frac {e g \operatorname {arsinh}\left (\frac {c g x}{\sqrt {a c} {\left | h x + g \right |}} - \frac {a h}{\sqrt {a c} {\left | h x + g \right |}}\right )}{\sqrt {a + \frac {c g^{2}}{h^{2}}} h^{2}} + \frac {d \operatorname {arsinh}\left (\frac {c g x}{\sqrt {a c} {\left | h x + g \right |}} - \frac {a h}{\sqrt {a c} {\left | h x + g \right |}}\right )}{\sqrt {a + \frac {c g^{2}}{h^{2}}} h} + \frac {\sqrt {c x^{2} + a} f}{c h} \]

input
integrate((f*x^2+e*x+d)/(h*x+g)/(c*x^2+a)^(1/2),x, algorithm="maxima")
 
output
-f*g*arcsinh(c*x/sqrt(a*c))/(sqrt(c)*h^2) + e*arcsinh(c*x/sqrt(a*c))/(sqrt 
(c)*h) + f*g^2*arcsinh(c*g*x/(sqrt(a*c)*abs(h*x + g)) - a*h/(sqrt(a*c)*abs 
(h*x + g)))/(sqrt(a + c*g^2/h^2)*h^3) - e*g*arcsinh(c*g*x/(sqrt(a*c)*abs(h 
*x + g)) - a*h/(sqrt(a*c)*abs(h*x + g)))/(sqrt(a + c*g^2/h^2)*h^2) + d*arc 
sinh(c*g*x/(sqrt(a*c)*abs(h*x + g)) - a*h/(sqrt(a*c)*abs(h*x + g)))/(sqrt( 
a + c*g^2/h^2)*h) + sqrt(c*x^2 + a)*f/(c*h)
 
3.2.5.8 Giac [F(-2)]

Exception generated. \[ \int \frac {d+e x+f x^2}{(g+h x) \sqrt {a+c x^2}} \, dx=\text {Exception raised: TypeError} \]

input
integrate((f*x^2+e*x+d)/(h*x+g)/(c*x^2+a)^(1/2),x, algorithm="giac")
 
output
Exception raised: TypeError >> an error occurred running a Giac command:IN 
PUT:sage2:=int(sage0,sageVARx):;OUTPUT:index.cc index_m i_lex_is_greater E 
rror: Bad Argument Value
 
3.2.5.9 Mupad [F(-1)]

Timed out. \[ \int \frac {d+e x+f x^2}{(g+h x) \sqrt {a+c x^2}} \, dx=\int \frac {f\,x^2+e\,x+d}{\left (g+h\,x\right )\,\sqrt {c\,x^2+a}} \,d x \]

input
int((d + e*x + f*x^2)/((g + h*x)*(a + c*x^2)^(1/2)),x)
 
output
int((d + e*x + f*x^2)/((g + h*x)*(a + c*x^2)^(1/2)), x)